import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import { getCart } from '@/api/cart'
export const useCartStore = defineStore('cart', () => {
    const cartList = ref([])
    async function getCartList(){
      
        const {data} = await getCart()
        data.forEach(it => it.isChecked = it.isChecked === 1)
        cartList.value = data
     
      
    }
    

  return { getCartList,cartList }
})
